import request from '@/utils/request.js'

/**
 * 手机号、验证码登录
 * @param formData:{mobile, smsCode=246810 验证码固定}
 */
export const loginApi = (formData) => {
  return request.post('/passport/login', {
    form: {
      ...formData,
      // 先写死
      isParty: false,
      partyData: {},
    }
  })
}

/**
 * 获取图形验证码
 * @param platform String
 */
export const platformApi = () => {
  return request.get('/captcha/image')
}

/**
 * 获取短信验证码
 * @param captchaCode string 图形验证码
 * @param captchaKey string 图形验证码key
 * @param mobile string 接收验证码手机
 */
export const sendSmsCaptchaApi = (data) => {
  return request.post('/captcha/sendSmsCaptcha', data)
}